package org.feng.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.feng.annotions.SensitiveData;
import org.feng.annotions.SensitiveEntity;
import org.feng.sensitive.Base64Sensitive;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户实体
 * </p>
 *
 * @author fengjinsong
 * @since 2023-08-24
 */
@Data
@SensitiveEntity
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("mp_user")
public class User implements Serializable {

    private static final long serialVersionUID = -5815272703292176485L;
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 电话
     */
    @SensitiveData(sensitiveType = Base64Sensitive.SENSITIVE_TYPE_CODE)
    private String phone;

    /**
     * 部门ID
     */
    private Integer deptId;

    /**
     * 创建人用户id
     */
    private Integer createUserId;

    /**
     * 创建人用户名
     */
    private String createUsername;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 逻辑删除，0表示未删除，1表示已删除
     */
    @TableLogic
    private Integer deleted;
}
